package com.the_ring.structural.decorator;

import java.math.BigDecimal;

/**
 * @author: t22306139
 * @date: 2023/11/29  15:59
 */
public class CoffeeDecorator extends Drink{

    private Drink drink;

    public CoffeeDecorator(Drink drink) {
        this.drink = drink;
    }

    @Override
    public BigDecimal cost() {
        return super.getPrice().add(drink.cost());
    }

    @Override
    public String getDescription() {
        return drink.getDescription() + "&&" + super.getDescription();
    }
}
